package com.example.springadvance.a08;

import jakarta.annotation.PreDestroy;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;

@Component
@Scope(WebApplicationContext.SCOPE_REQUEST)
public class BeanScopeForRequest {

    public BeanScopeForRequest() {
        System.out.println("BeanScopeForRequest constructor");
    }

    @PreDestroy
    public void destroy() {
        System.out.println("BeanScopeForRequest destroy");
    }
}
